package service

import (
	"blog/dao"
	"blog/entity"
)

/*
获取user表全部数据
*/
func GetUserList() []entity.User {
	userList := dao.GetUserList()
	return userList
}

/*
根据id查询用户
*/
func GetUserBayID(id int) interface{} {
	var boolUser entity.User
	user := dao.GetUserBayID(id)
	if user == boolUser {
		return nil
	}
	return user
}

/*
新增用户
*/
func SaveUser(user entity.User) {
	dao.SaveUser(user)
}

/*
修改用户信息
*/
func UpdateUser(user entity.User) {
	dao.UpdateUser(user)
}

/*
根据id删除用户
*/
func DelUserBayId(id int) {
	dao.DelUserBayId(id)
}

/*
批量删除
*/
func DelUserIds(ids []int) {
	dao.DelUserIds(ids)
}
